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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.o: G = None
        self.z: E = None
        self.w: A = None
        self.x: B = None
        self.v: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.u: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.o: G = None
        self.z: E = None
        self.w: A = None
        self.x: B = None
        self.v: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.u: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

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

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

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