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

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.y: A = None
        self.s: A = None
        self.q: F = None
        self.p: D = None
        self.u: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.z: E = None
        self.r: E = None
        self.y: C = None
        self.u: B = None
        self.p: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.p: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.z: E = None
        self.txt = txt

h = A("h")
c = B("c")
b = C("b")
g = D("g")
j = E("j")
i = F("i")
l = E("l")
f = B("f")

h.v = l
c.p = b
c.y = h
c.q = f
c.v = f
c.w = i
c.t = i
b.x = i
b.q = i
b.y = h
b.s = h
b.u = h
b.p = g
g.x = i
g.z = l
g.r = l
g.y = b
g.u = f
g.p = h
j.y = i
j.p = b
i.y = j
i.z = j
l.y = i
l.p = b
f.p = b
f.y = h
f.q = c
f.v = c
f.w = i
f.t = i
assert g.y.x.y.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.y: A = None
        self.s: A = None
        self.q: F = None
        self.p: D = None
        self.u: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.z: E = None
        self.r: E = None
        self.y: C = None
        self.u: B = None
        self.p: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.p: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.z: E = None
        self.txt = txt

h = A("h")
c = B("c")
b = C("b")
g = D("g")
j = E("j")
i = F("i")
l = E("l")
f = B("f")

h.v = l
c.p = b
c.y = h
c.q = f
c.v = f
c.w = i
c.t = i
b.x = i
b.q = i
b.y = h
b.s = h
b.u = h
b.p = g
g.x = i
g.z = l
g.r = l
g.y = b
g.u = f
g.p = h
j.y = i
j.p = b
i.y = j
i.z = j
l.y = i
l.p = b
f.p = b
f.y = h
f.q = c
f.v = c
f.w = i
f.t = i
assert g.y.x.y.txt == "j"