class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.x: G = None
        self.t: A = None
        self.z: F = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: F = None
        self.v: G = None
        self.y: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.y: B = None
        self.s: B = None
        self.o: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: D = None
        self.v: E = None
        self.txt = txt

i = A("i")
l = B("l")
b = C("b")
h = D("h")
d = E("d")
c = F("c")
g = G("g")
m = E("m")
e = F("e")

i.p = l
l.r = g
l.x = g
l.t = i
l.z = e
l.u = m
b.t = l
b.w = c
b.v = g
b.y = m
h.t = g
h.y = l
h.s = l
h.o = m
d.v = l
c.x = b
g.s = d
g.y = h
g.v = m
m.v = l
e.x = b
assert d.v.z.x.y.v.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.x: G = None
        self.t: A = None
        self.z: F = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: F = None
        self.v: G = None
        self.y: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.y: B = None
        self.s: B = None
        self.o: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: D = None
        self.v: E = None
        self.txt = txt

i = A("i")
l = B("l")
b = C("b")
h = D("h")
d = E("d")
c = F("c")
g = G("g")
m = E("m")
e = F("e")

i.p = l
l.r = g
l.x = g
l.t = i
l.z = e
l.u = m
b.t = l
b.w = c
b.v = g
b.y = m
h.t = g
h.y = l
h.s = l
h.o = m
d.v = l
c.x = b
g.s = d
g.y = h
g.v = m
m.v = l
e.x = b
assert d.v.z.x.y.v.txt == "l"