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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: G = None
        self.v: D = None
        self.t: D = None
        self.p: A = None
        self.s: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: G = None
        self.v: D = None
        self.t: D = None
        self.p: A = None
        self.s: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

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

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

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