class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.r: E = None
        self.z: F = None
        self.s: C = None
        self.t: F = None
        self.v: D = None
        self.y: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: A = None
        self.u: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.x: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.y: C = None
        self.u: B = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: A = None
        self.u: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.x: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.y: C = None
        self.u: B = None
        self.txt = txt

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

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

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